﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeBackup.Code
{
    public class ini
    {
        private static IniFile iniFile = new IniFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "CodeBackup.ini"));


        public static string SaveDirec
        {
            get { return iniFile.GetString("data", "Save", AppDomain.CurrentDomain.BaseDirectory); }
            set { iniFile.WriteString("data", "Save", value); }
        }



         public static bool repcode
        {
            get { return iniFile.GetBool("data", "repcode", false); }
            set {  iniFile.WriteBool("data", "repcode", value); }
        }

        public static string Api
        {
            get { return iniFile.GetString("data", "Api", string.Empty); }
            set { iniFile.WriteString("data", "Api", value); }
        }


        public static string Mqtt
        {
            get { return iniFile.GetString("data", "Mqtt", string.Empty); }
            set { iniFile.WriteString("data", "Mqtt", value); }
        }


        public static int Port
        {
            get { return iniFile.GetInt("data", "Port", 0); }
            set { iniFile.WriteInt("data", "Port", value); }
        }

        public static string Mqttuser
        {
            get { return iniFile.GetString("data", "Mqttuser", string.Empty); }
            set { iniFile.WriteString("data", "Mqttuser", value); }
        }


        public static string Mqttpas
        {
            get { return iniFile.GetString("data", "Mqttpas", string.Empty); }
            set { iniFile.WriteString("data", "Mqttpas", value); }
        }
    }
}
